<style>
.width {
	min-width: 119px;
}
	.modalwidth {
	width: 550px;	
	height: 240px;
}
</style>
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading">
			MEMBER MANAGEMENT 
		</header>
		<div class="panel-body">
		
		
		<div class="input-group col-lg-5 pull-right">
                                          <form name="action" method="POST"
							action="<?=base_url(); ?>secure/reports/member_report">
							
							<div class="col-lg-offset-2 col-lg-7">
							</div>
							 <select class="form-control" name="order"  style="width:100px"
								onchange="this.form.submit()">
								<option value="">-Select-</option>
								<option value="inactive">Inactive</option>
								<option value="active">Active</option>
							
							</select>
						</form>
                                          
                                          
                                             
                                              </div>
		
			<table class="table table-striped table-advance table-hover">
				<thead>
					<tr>
						<th><i class="icon-bullhorn"></i> ID</th>
						<th class="hidden-phone"><i class="icon-question-sign"></i> Name</th>
						<th><i class="icon-bookmark"></i> Email</th>
						<th><i class="icon-bookmark"></i> Last Login</th>
						<th><i class="icon-bookmark"></i> Last Login Ip</th>
						<th><i class="icon-bookmark"></i> Status</th>
						<th><i class=" icon-edit"></i> Action</th>
					</tr>
				</thead>
				<tbody>
					<?php if($member['all']){?>
				<?php foreach ($member['all'] as $member) : ?>
					<tr>
						<th><?= $member->id;?>
						</th>
						<td class="hidden-phone"><?= $member->name; ?></td>
						<td><?= $member->email; ?> </td>
						<td><?= $member->last_login_date; ?></td>
						<td><?= $member->last_login_ip; ?>
						</td>
						<td><?php if($member->status ==51){?>
							<button class="btn btn-success btn-xs">
								<i class=" icon-ok"> Active</i>
							</button> <?php }else{?>
							<button class="btn btn-danger btn-xs">
								<i class=" icon-remove"> Inactive</i>
							</button> <?php }?></td>


						<td>

							<div class="dropdown">
								<a href="javascript:;"
									class="dropdown-toggle btn btn-danger btn-xs"
									data-toggle="dropdown">Menu <b class="caret"></b>
								</a>
								<ul class="dropdown-menu width">
									<li>
									<?php if($member->status ==1){?>
									<a href="<?= base_url();?>secure/reports/member_report/change_member_status/<?= $member->status?>/<?= $member->id;?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');">
									<button
												class="btn btn-primary btn-xs">
												<i class="icon-thumbs-up"></i>
											</button> Active</a>
											
											</li>
											
									<li>
									<?php }else{?>
									<a href="<?= base_url();?>secure/reports/member_report/change_member_status/<?= $member->status?>/<?= $member->id;?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"
									><button
												class="btn btn-danger btn-xs">
												<i class="icon-thumbs-down"></i>
											</button> Inactive</a>
											<?php }?>
											
											</li>
									<li><a href="<?= base_url();?>secure/reports/member_report/delete_member/<?= $member->id;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-danger btn-xs">
												<i class="icon-trash"></i>
											</button> Delete</a></li></ul>
							
							</div>
						</td>
					</tr>


					
					<!-- /.modal -->


					<?php endforeach; 
}else { echo "No Data found....";
}?>

				</tbody>
			</table>

			<div class="row">
				<div class="col-sm-6"></div>
				<div class="col-sm-6">
					<div class="dataTables_paginate paging_bootstrap pagination">
						<ul>
						<?php  echo $this->pagination->create_links(); ?>
							
						</ul>
					</div>
				</div>
			</div>


		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
</section>

